#include<stdio.h>
#include<stdlib.h>

void output(unsigned char a[][10], char flat[][160], int n, int cs);
void input(unsigned char a[][10], FILE *, char *str);
int main()
{
        int cs=0, s=0;
        int j,i;
        int n=0;
        unsigned char a[95][10] = {0};
        char str[20]={0};
        char flat[10][160] = {0};
        for(i=0;i<10;i++){
                for(j=0;j<160;j++){
                        flat[i][j]=' ';
                }
        }
        FILE *p=NULL;
        p=fopen("ASC10x8.dic","rb");
        if(p==NULL)
        {
                printf("Failed to open the documents.");
        }
        input(a, p, str);
        while(str[s]!='\0'){
                n=(int)str[s]-32;
                output(a, flat, n, cs);
                cs++;
                s++;
        }

        for(i=0;i<10;i++)
        {
                flat[i][cs*8]='\0';
        }
        for(i=0;i<10;i++)
        {
                printf("%s\n", flat[i]);
        }
        fclose(p);

        return 0;
}

void input(unsigned char a[][10], FILE *p, char * str)
{
        fread(a, 10, 95, p);
        gets(str);
}
void output(unsigned char a[][10], char flat[][160], int n, int cs)
{
        int q=0;
        int j=0, i=0;
        for(i=0;i<10;i++){
                q=a[n][i];
                for(j=7;q!=0;j--){
                        if(q%2==1){
                                flat[i][cs*8+j]='#';
                        }
                        if(j==0){break;}
                        q=q/2;
                }
        }
}